<template>
    <div class="go-back">
        <button @click="jumpTo">
            <!-- 跳转首页 -->
            <van-icon name="wap-home-o" />
        </button>
    </div>
</template>

<script>
export default {
    // 自定义属性接收父组件传递的值
    props: {
        url: {
            type:String,
            default: '/index/focus'
        }
    },
    methods: {
        jumpTo(){
            this.$router.push({path: this.url});
        }
    }
}

</script>

<style lang="less">
.go-back {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 15px;
    z-index: 1000;
    button {
        background-color: transparent;
        width: 40px;
        height: 40px;
        border: 1px solid #ccc;
        border-radius: 10px;
        color: #ccc;
    }
}
</style>